package com.aaa.entity;

import javax.persistence.*;
import java.sql.Date;
import java.util.Objects;

/**
 * fileName:ExamEntity
 * description:
 * author:王宇航
 * createTime:2019/10/10 14:56
 * version:1.0.0
 */
@Entity
@Table(name = "exam", schema = "trainingdb", catalog = "")
public class ExamEntity {
    private int id;
    private String examName;
    private Date date;
    private int state;
    private int delFlag;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "exam_name")
    public String getExamName() {
        return examName;
    }

    public void setExamName(String examName) {
        this.examName = examName;
    }

    @Basic
    @Column(name = "date")
    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Basic
    @Column(name = "state")
    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    @Basic
    @Column(name = "del_flag")
    public int getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(int delFlag) {
        this.delFlag = delFlag;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ExamEntity that = (ExamEntity) o;
        return id == that.id &&
                state == that.state &&
                delFlag == that.delFlag &&
                Objects.equals(examName, that.examName) &&
                Objects.equals(date, that.date);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, examName, date, state, delFlag);
    }
}
